<template>
  <div>
    <p>犬只查询</p>
     <div class="demo-input-size">
  <el-input
    placeholder="请输入犬主姓名"
    style="width: 160px"
    v-model="name">
  </el-input>
  <el-input
    placeholder="请输入犬主证件号"
    style="width: 160px"
    v-model="icd">
  </el-input>
  <el-input
    placeholder="请输入犬主电话"
    style="width: 160px"
    v-model="tel">
  </el-input>
  <el-input
    placeholder="请输入犬牌编号"
    style="width: 160px"
    v-model="dogetc">
  </el-input>
   <el-button type="primary" style="width: 140px" @click="onSubmit()">查询</el-button>
</div>
    <div v-if="this.dog != null">
      <label>犬名：{{this.dog.dname}}</label><br/>
      <label>犬种{{this.dog.type}}</label><br/>
      <label>性别：{{this.dog.sex}}</label><br/>
      <label>重：{{this.dog.weight}}cm</label><br/>
      <label>高：{{this.dog.height}}cm</label><br/>
      <label>长：{{this.dog.longth}}cm</label><br/>
      <label>正面照：<img width="100px" height="100px" :src="this.dog.dog_positive_image"/></label><br/>
      <label>侧面照：<img  width="100px" height="100px" :src="this.dog.dog_side_image"/></label><br/>
      <label>犬主：{{this.dog.u_id}}</label><br/>
      <label>犬牌编号：{{this.dog.dogetc}}</label><br/>
      <label>录入时间:{{this.dog.regist_date}}</label><br/>
      <label>年审时间:{{this.dog.annual_review_date}}</label><br/>
      <label>状态:<font v-if="this.dog.status == 1" color="green">正常</font>
                  <font v-if="this.dog.status == 2" color="red">收缴</font>
                  <font v-if="this.dog.status == 3" color="yellow">弃养</font><br/>
                  <font v-if="this.dog.annual_review_date <= now" color="red">年审逾期</font>
      </label><br/>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  data () {
    return { 
      name: '张三',
      icd: '51011234asfaf5',
      tel: '12345678912',
      dogetc: '33333333',
      dog: null
    }
  },
  methods: {
    onSubmit(){
      axios.get("http://localhost:9091/user/pet/selectDog?name=" + this.name +
      "&icd=" + this.icd + 
      "&tel=" + this.tel +
      "&dogetc=" + this.dogetc).then(res => { 
          if(res.data.code == 200){
            this.$message({
              type: "success",
              message:res.data.message
            });  
           this.dog=res.data.data
             
          }
           
      });
    }
  },
  mounted () {
    
  },
  computed: {},
};
</script>
<style scoped></style>
